package com.tianyu.inspection.common;

import com.alibaba.fastjson2.JSONObject;

import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;

/**********************************
 * @Author YSW
 * @Description
 * @Date 2022/7/19 - 09:59
 **********************************/

public class ApiModel {

    public static JSONObject getJSONObject(HttpServletRequest request) {
        final JSONObject jsonObject = new JSONObject();
        Enumeration<String> parameterNames = request.getParameterNames();
        while (parameterNames.hasMoreElements()) {
            String element = parameterNames.nextElement();
            jsonObject.put(element, request.getParameter(element));
        }
        return jsonObject;
    }
}
